//
//  SRAlipay.m
//  mall
//  支付宝支付
//  Created by 一米阳光 on 15/8/2.
//  Copyright (c) 2015年 seekool. All rights reserved.
//

#import "SRAlipay.h"
#import <AlipaySDK/AlipaySDK.h>
#import "NSString+URLEncode.h"

@implementation SRAlipay


+ (void)alipay
{
    Order *order = [[Order alloc] init];
    order.partner = @"";
    order.seller = @"";
//    
//    order.tradeNO = @"";
//    order.productName = _productName;
//    order.productDescription = @" ";
//    
//    NSString *total = [NSString stringWithFormat:@"%@",_orderSumMoney];
//    order.amount = [NSString stringWithFormat:@"%.2f", [total floatValue]];
//    order.notifyURL = CART_NOTIFY_URL;
    order.service = @"mobile.securitypay.pay";
    order.paymentType = @"1";
    order.inputCharset = @"utf-8";
    order.itBPay = @"30m";
    order.showUrl = @"m.alipay.com";
    NSString *orderInfo = [order description];
    
    NSDictionary *result = @{@"sign":@"sign"};
    
    NSString *signedStr = [result[@"sign"] urlencode];
    NSString *orderString = [NSString stringWithFormat:@"%@&sign=\"%@\"&sign_type=\"%@\"", orderInfo, signedStr, @"RSA"];
    //支付宝快捷支付
    [[AlipaySDK defaultService] payOrder:orderString fromScheme:@"www.baidu.com" callback:^(NSDictionary *resultDic) {
        //        [self AlipayResult:resultDic];
//        
    }];
    
    

    
    
}

@end
